let path = require("path");

exports.lookPic = (Router) => {
	Router.get("/public/:filename", (req, res) => {
		const filePath = path.join(
			process.cwd(),
			"src/uploads",
			req.params.filename
		);
		res.sendFile(filePath, (err) => {
			if (err) {
				console.error("File not found:", err);
				res.status(404).send("File not found");
			}
		});
	});
};
